package appcore

import (
	"net/http"

	"gitee.com/chenrh/ios-local/AppDdistribute/appcore/pagerouter"
	"gitee.com/chenrh/ios-local/AppDdistribute/internal/svc"
	"github.com/zeromicro/go-zero/rest"
)

func RegisterHtmlHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {

	// 首页路由
	server.AddRoute(rest.Route{Method: http.MethodGet, Path: "/", Handler: pagerouter.Index})

	// 所有安装包
	server.AddRoute(rest.Route{Method: http.MethodGet, Path: "/list", Handler: pagerouter.List})

	// 某应用的版本列表
	server.AddRoute(rest.Route{Method: http.MethodGet, Path: "/list/app", Handler: pagerouter.AppVersionList})

	// 某应用的安装界面
	server.AddRoute(rest.Route{Method: http.MethodGet, Path: "/app/install", Handler: pagerouter.AppInstall})

	// 上传应用地址
	server.AddRoute(rest.Route{Method: http.MethodGet, Path: "/upload-form", Handler: pagerouter.UploadForm})
	server.AddRoute(rest.Route{Method: http.MethodPost, Path: "/upload", Handler: pagerouter.Upload})

}
